Skip to content

feat(spec): count_true / count_false — a boolean column's Yes / No counts in the list footer - #35944

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-9i3wbo
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-9i3wbo

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #35702

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — no page under skills/** lists the column summary members; the docs that do (content/docs/ui/views.mdx, the generated content/docs/references/ui/view.mdx, the plugin-grid README) are updated here

repo:objectstack#1 · os-sales · session_01L6bhgVspkxqkUdkYxY1RHf

Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z 「所有 p1 都按照新规则执行」): the card thread builds itself; L1 and the isolated L2 run in parallel at hand-back, the maintainer's 09:22Z ruling for every p1 card (deviates from contract-review.md:18 until the skill card lands).

The second and last PR of #35702 (PR 1 #35919, merged f909734, left exactly this): the boolean 「是」/「否」 counts the card's 要做的 lists — 「补两种计算:布尔字段的「是」的条数、「否」的条数」. Clause-② is a widening: ColumnSummarySchema gains two members, and the derived rows of ColumnSummaryAggregation gain a reads list (from stays, the first of them). Contract face, L2 at CONTRACT_REVIEW_TIER.

Null-cell ruling: record 7051689474 on #35702 — the maintainer chose 「不算,未填单独算「空」」 (option A, 2026-11-20 22:01:58Z). count_true counts the cells holding true, count_false the cells holding false (count_FIELD − sum_FIELD, never the record count); a cell with no value is in neither and shows under 「空」 (count_empty), so 是 + 否 = the filled count; with every value null, or no rows, 「是」 reads 0. That is what this PR builds.

维护者速读

  • 列表底部计算行里,开关(布尔)列的菜单最前面多了「「是」的条数」「「否」的条数」两项,选了显示成「是 12」「否 3」。这两个数目前只出现在底部计算行:服务端已能在分组标题上算出它们,但控制台的分组标题读的是另一套汇总设置,还没有画出来。
  • 属于「列表页重做」专题里「列表底部计算行」这张卡的最后一部分,做完这张卡就关闭。
  • 没填值的记录两边都不算,算在「空」里(按你在决策卡上的选择);别的类型的列菜单里不会出现这两项,元数据里硬写到数字列上会在校验时被拒;出问题撤回这个改动即可。
  • 无。

What changes

  • Spec (packages/spec/src/ui/view.zod.ts, view-grouping-query.ts). ColumnSummarySchema gains count_true and count_false. Both map by DERIVATION, the fork-i route the four filled / empty members took — no new AggregationFunction, no driver change: booleans aggregate as numbers on every backend (ruling [finding] AGGREGATION_ROWS has no boolean column, so the cross-driver aggregation conformance family cannot see a boolean aggregand on any face #11152, aggregation-conformance's sum(flag) row on six backends), so count_true = SUM(field) and count_false = COUNT(field) − SUM(field). COLUMN_SUMMARY_AGGREGATION's derived rows carry reads, every node the member reads (count_true: ['sum']; count_false: ['sum', 'count']; the four filled / empty: ['count']). columnSummaryNodeFunctions(mapping) is the one reading of a row's nodes; the group header compiler uses it, and so do the footer's whole-set query and the lint below. deriveColumnSummary reads count_true as the sum, 0 when the sum answered no value (no non-null cell), and count_false as the non-null count less the sum. COLUMN_SUMMARY_FIELD_TYPES / isColumnSummaryCompatibleWithFieldType restrict the two members to the boolean class (boolean, toggle, pinned equal to BOOLEAN_VALUE_TYPES).
  • Lint (packages/lint/src/validate-list-view-field-refs.ts). columnSummaryRefusal judges a restricted member by that table: count_true / count_false over any other type is list-view-summary-field-type-refused (error). The aggregate door ACCEPTS SUM(field) over a number, so without this the footer would print a total under the label 「是」 and nothing would refuse it. Its os explain entry gains the paragraph.
  • Footer (ui/packages/plugin-grid). offeredColumnSummaries lists Count of Yes / Count of No first on a boolean or toggle column, and only where the spec's table allows them. wholeSetSummaryNodes asks every node a member reads (one SUM(approved) and one COUNT(approved) serve both counts and count_empty). The page fallback computes them off the rows as the cell reads them: only a real true / false is a value, so a null cell is neither, as on the server. The figure is drawn as Yes 12 / No 3, a plain count.
  • i18n. grid.summary.countTrue / countFalse (the footer word, the pack's own Yes / No) and menuCountTrue / menuCountFalse (the menu entry) in all eleven packs.
  • Docs: content/docs/ui/views.mdx, the plugin-grid README; generated content/docs/references/ui/view.mdx, api-surface/ui.json, export-origins/ui.json. Changeset 35702-boolean-yes-no-counts.md (@objectstack/spec and @objectstack/lint minor, Metadata-protocol: added; @object-ui/plugin-grid, @object-ui/i18n patch).

Read first, by risk: packages/spec/src/ui/view-grouping-query.ts (the reads rows, deriveColumnSummary's new branch, summaryAggregationNodes' loop), packages/lint/src/validate-list-view-field-refs.ts (columnSummaryRefusal's restricted arm, which now resolves the field before the aggregate-kind early return), ui/packages/plugin-grid/src/useWholeSetSummary.ts (wholeSetSummaryNodes).

Tests

New:

  • packages/spec/src/ui/view-grouping-query.test.ts — count_true / count_false: the compiled nodes (one sum_approved, the shared count_approved); per group, a null cell in neither count and true + false = filled (3 / 2 / 1 null; all null reads 0 / 0; no true reads 0); a sum that answered no value reads 0 true, a missing column reads undefined, a string-spelled sum reads as a number; the field-type table (boolean class only, pinned to BOOLEAN_VALUE_TYPES, fail-closed on shape); columnSummaryNodeFunctions over every row kind; the alias collision on a field named sum_approved. The mapping-table pin carries the two new rows and reads on every derived row.
  • packages/rest/src/list-view-grouping-query-door.test.ts §7b — the real aggregate door, on driver-sql (better-sqlite3) and the in-memory tier: the compiled grouped query and the footer's whole-set query (no groupBy) answer each unit's and the whole set's true / false / empty counts, tallied off the seeded rows (every fourth unset); the one-row unit with no true reads 0.
  • packages/lint/src/validate-list-view-field-refs.test.ts — refuses the two members over a number and a text field (object form too), accepts them on booleans, and agrees with the spec's table over every FieldType.
  • ui/packages/plugin-grid/src/__tests__/footerCalculationPicker-35702.test.tsx — the boolean / toggle offer (the two counts first, no arithmetic); never on number, currency, text, select, date, lookup; a boolean column's menu lists Count of Yes / Count of No first, a pick draws Yes 1 then No 1.
  • ui/packages/i18n: zh-Hant.ts regenerated from zh-Hans.ts (gen:zh-hant; the first CI run's Test UI 8/16 red was this file hand-written).
  • ui/packages/plugin-grid/src/__tests__/footerSummaryScope-12081.test.tsx — 300 rows over pages of 25: the yes / no / empty counts read the whole set off one SUM and one COUNT node; with no aggregate door they are the page's, labelled (this page), and an unset cell is neither.

Migrated: the COLUMN_SUMMARY_AGGREGATION pin (reads on the derived rows), view.test.ts's member list, the ui/packages/types parity list (two members added). Voided: none.

Local runs

Head 5107231a (the last commit is the generated zh-Hant.ts only; every run below is on 1d91bf50 or later unless named):

  • @objectstack/spec: vitest run src/ui/view-grouping-query.test.ts src/ui/view.test.ts — Test Files 2 passed (2), Tests 550 passed (550), lock VERDICT command-exit 0. typecheck (incl. check:test-typecheck) exit 0. check:api-surface, check:docs, check:export-origins were red before gen:api-surface / gen:schema + gen:docs / gen:export-origins, green after; check:authorable-surface, check:liveness, check:llms-txt exit 0.
  • @objectstack/lint: validate-list-view-field-refs, validate-sortable-fields, rule-explanations — Test Files 3 passed (3), Tests 316 passed (316); typecheck exit 0.
  • @objectstack/rest: list-view-grouping-query-door.test.ts (driver-sql better-sqlite3 + in-memory) — Test Files 1 passed (1), Tests 55 passed (55); typecheck exit 0.
  • ui: plugin-grid (footerCalculationPicker-35702, footerSummaryScope-12081, useColumnSummary, useColumnSummary.i18n-4024, column-features) + types/spec-subschema-parity — Test Files 6 passed (6), Tests 141 passed (141); the whole packages/i18n/ project after the regeneration — Test Files 105 passed (105), Tests 1957 passed | 13 skipped; vitest run scripts/ — Test Files 172 passed | 2 skipped.
  • Derived gate families (dispatch-gates --commands, 120 on this tree): --ran reads 118 run, 2 NOT MEASURED, 0 UNRUN. NOT MEASURED: check:dual-build-cjs-loads (PREREQUISITE NOT MET: dists of untouched packages absent), check:type-check-debt (ran past the local 300 s window). One recorded red is the container, not the diff: check:dts-closure names packages/cli, plugins/organizations and verify .d.ts missing, packages this PR does not touch, built OS_SKIP_DTS=1 here for the browser stand. CI's runs are the reading for all three.
  • NOT MEASURED locally: @object-ui/plugin-grid / @object-ui/i18n type-check (the ui dependency closure's declarations are not built in this container: every error is TS2307 on an @object-ui/* import or downstream of one, none in the two changed source files); Type Check UI is the reading.

Acceptance notes

  • Card acceptance 「布尔列有「是」「否」的条数」: the boolean column's menu offers both, first; they draw at once, over the whole matched set (the existing whole-set read) or the page, labelled as the page's.
  • Disclosed, not in scope: the record edit form draws an unset boolean as an unticked box (ui/packages/fields/src/widgets/BooleanField.tsx:124,139), while the list cell draws it as "No value". Under A an unset value is not counted as 「否」 even though the form shows it unticked.
  • A count_true / count_false column's whole-set figure waits for the object's field catalogue, as every sum node does (isMoneyAggregate: a record-mode currency check, ADR-0144 D6); the page figure shows until then, labelled as the page's.
  • The group header compiler reads no field types, so a hand-written count_true over a number reaching the server unlinted would answer that column's sum. The lint is the refusal (os validate, os build, the save door through the reference-integrity suite), the same tier the aggregate × field-type pairs are judged at.

Verification

Browser (showcase, own backend :43744 + console dev :53744 off this branch, admin), evidence in /mnt/project-files/build-seat1/35702-pr2/:

  • Field Zoo's list, the Boolean column's footer menu: Count of Yes, Count of No, then Unique, Filled, Empty, Percent filled, Percent empty, None (b-02-boolean-menu.png). The Number and Rating columns' menus list Sum / Avg / Min / Max and the counts, the Name and Select columns the counts only — no Count of Yes / No on any of them.
  • On a personal view of Field Zoo (Name, Boolean, Number): pick Count of Yes → PATCH /api/v1/data/sys_personal_view/ID 200 with only f_boolean gaining summary: "count_true" → the cell reads "Yes 1" (b-12) → reload → still "Yes 1" (b-13) → pick Count of No → PATCH 200, "No 1" (b-14). The two seeded rows hold true and false.
  • The runtime's aggregate door on the same stand, POST /api/v1/data/showcase_field_zoo/query with the footer's nodes answers { count: 2, sum_f_boolean: 1, count_f_boolean: 2 } (Yes 1, No 1).
  • The package view showcase_field_zoo.default: the pick's draft save answers 403 and the pick is taken back, PR 1's documented behaviour for a view a read-only package ships.
  • NOT MEASURED in the browser: a null boolean cell (the showcase's Field Zoo refuses a new row without its required master-detail) and the whole-set path over more than one page (two rows); both are pinned on the real door (§7b) and in the 300-row footer suite.

Two-minute check: on any object with a boolean field, open its table view as an admin, click under the boolean column — the menu starts with "Count of Yes" / "Count of No"; pick one, the cell reads "Yes N" at once.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic beyond the pure mapping helpers that already live there.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; the repo-wide pnpm lint is CI's.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVspkxqkUdkYxY1RHf

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 20 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ui/views.mdx (via count_empty (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION), count_false (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION; a field of const object COLUMN_SUMMARY_FIELD_TYPES), count_filled (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION), count_true (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION; a field of const object COLUMN_SUMMARY_FIELD_TYPES), percent_empty (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION), percent_filled (symbol, a field of const object COLUMN_SUMMARY_AGGREGATION), count_false (literal, a string literal in ColumnSummarySchema; a string literal in deriveColumnSummary), count_true (literal, a string literal in ColumnSummarySchema; a string literal in deriveColumnSummary))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-4.mdx (via deriveColumnSummary (symbol, a top-level function))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/export-origins/ui.json) — pages documenting those are invisible to this run
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 170ca481f0aeec14ca06d74ec3d57c654997e698 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c1bdbfc37703057eb361f6d610f5f1825f54be22 — the merge of head 5107231a969fa2c19b78f8a29e46002c30c16a85 into base 170ca481f0aeec14ca06d74ec3d57c654997e698, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c1bdbfc37703057eb361f6d610f5f1825f54be22 && git checkout c1bdbfc37703057eb361f6d610f5f1825f54be22
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 170ca481f0aeec14ca06d74ec3d57c654997e698 5107231a969fa2c19b78f8a29e46002c30c16a85 && git checkout -B drift-repro 170ca481f0aeec14ca06d74ec3d57c654997e698 && git merge --no-ff 5107231a969fa2c19b78f8a29e46002c30c16a85

node scripts/docs-audit/affected-docs.mjs --json 170ca481f0aeec14ca06d74ec3d57c654997e698

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 170ca481f0aeec14ca06d74ec3d57c654997e698 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b), CI pending

Head-sha: 5107231 · read 2026-11-20T22:18Z · full read, base f909734 (PR 1 #35919 merged) · L1 only, never an L2 (Metadata-protocol added → the seat's contract L2 at CONTRACT_REVIEW_TIER)

维护者速读

  • 是/否列(含开关类型)的底部计算菜单新增「「是」的条数」「「否」的条数」,放在最前面;其他类型的列不出现这两项,在元数据里写错类型会被校验直接拒绝。
  • 按你 22:01 的裁定 A:没填值的记录不算「否」,算在「空」里,所以 是 + 否 = 已填条数;全空或没有记录时「是」显示 0。
  • 服务端没有新的统计函数,用的是平台已经规定好的「布尔按数字求和」,六种数据库都已验证过,所以不涉及数据库改动。
  • 没有发现要改的问题。CI 还在跑,绿了 L1 就完成,然后由席位做规格层面的 L2。

Checked

  • Ruling A (7051689474) in code:
    • count_false = count_<field> − sum_<field> (the non-null count), never the group count (deriveColumnSummary).
    • count_true reads 0 when SUM answers no value, which covers all-null and no rows.
    • The page fallback counts === true / === false, so a null cell is in neither, the same reading as the server.
    • Pinned on every tier by the rest door's §7b: rows with approved null, true and false; per group and over the whole set; true + false + null = total; a one-row group reads count_true 0, not blank.
  • Premise: no new AggregationFunction. SUM(boolean) as the true count rests on ruling [finding] AGGREGATION_ROWS has no boolean column, so the cross-driver aggregation conformance family cannot see a boolean aggregand on any face #11152. aggregate-field-type-compatibility.ts already admits the boolean class in the sum row, and the Mongo driver coerces booleans in the arithmetic aggregates (mongodb-aggregation.ts:788). No driver push-down change, and SQL-first holds: both nodes are ordinary aggregate nodes on the header / whole-set query.
  • One reading of a row's nodes. columnSummaryNodeFunctions(mapping) feeds the group header compiler (summaryAggregationNodes, with the collision check per node), the footer's whole-set query (wholeSetSummaryNodes, with the currency check over every node) and the lint. count_false asks two nodes (sum_approved, count_approved); the §7b test pins that exact aggregation list.
  • Type restriction.
    • COLUMN_SUMMARY_FIELD_TYPES holds {count_true, count_false} → boolean, toggle, the same as the spec's BOOLEAN_AGGREGATE_FIELD_TYPES. It is read through isColumnSummaryCompatibleWithFieldType, which fails closed on shape.
    • The lint refuses the pair on any other type under the existing list-view-summary-field-type-refused (an error). It covers the object form { type, field } too, and its explanation entry is updated.
    • The footer menu offers the pair first, and only where that same function allows it. b-02 shows the menu on a boolean column: Count of Yes, Count of No, then the count family, with no arithmetic.
  • Browser (build-seat1/35702-pr2/): a personal view on Field Zoo picks Count of Yes, which survives a reload (b-11 to b-13), then Count of No (b-14, "No 1"). No unset boolean was in that list, so the null half of ruling A is pinned at the server door and in unit tests, not in a screenshot. That is enough here, because the door is the boundary the figure crosses.
  • Face (l1-face):
    • Fixes #35702 is right; this is the card's last PR.
    • Clause-②: yes (widening), Metadata-protocol: added, Skills-docs: none with its reason (no skills/** page lists the summary members; checked).
    • Changeset: minor on @objectstack/spec and @objectstack/lint, patch on plugin-grid and i18n.
    • The face flags @objectstack/rest and @object-ui/types with no changeset entry. Both touches are test files only (list-view-grouping-query-door.test.ts, spec-subschema-parity.test.ts), so nothing they publish changes.
  • Generated artifacts and text. The api-surface/ui.json and export-origins rows cover the four new exports. The reference view.mdx is regenerated. I read the changeset, views.mdx, the reference description and the README sentence by sentence; all are true against the code.
  • i18n. Four grid.summary keys in all 11 packs. zh-Hans 是 / 否 / 「是」的条数 / 「否」的条数. zh-Hant was regenerated in its own commit (5107231); zh-hant-generated decides on green.
  • Regions. The UI part is only useColumnSummary.ts (menu, labels, page fallback) and useWholeSetSummary.ts. There is no ObjectGrid.tsx, ListView.tsx or data-table.tsx hunk, so there is no overlap with feat(list): a two-row list toolbar — View settings beside the view name, a resident condition row, ⋮ More at the far right #35918 or feat(console)!: one way to open a record from an object's list; navigation.mode deprecated there #35910.

For the L2 (boundary note, not a finding)

  • ColumnSummaryAggregation's derived row widens from from the literal 'count' to 'count' | 'sum' and adds reads. A published consumer that read from as always 'count' would now see 'sum' for the two new members. The PR moves every in-repo reader to columnSummaryNodeFunctions. Whether that output-type widening is a plain widening is the L2's call on the declaration face.

Owed

  • CI green on 5107231a (30 pending at read; TypeScript Type Check not yet reported); L1 final then.
  • Seat: contract L2 at CONTRACT_REVIEW_TIER on the green head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-20T22:39Z. The brief handed to the isolated contract reviewer at CONTRACT_REVIEW_TIER for PR #35944 (owed by the published-schema face packages/spec/src/ui/** and the PR's Clause-②: yes (widening) line). The record follows as its own comment.

Contract review brief — PR #35944 @ 5107231a969fa2c19b78f8a29e46002c30c16a85 (card #35702)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/ui/view-grouping-query.ts packages/spec/src/ui/view.zod.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35702: its body and EVERY comment (rulings and earlier records included)
· PR #35944: its body, its file list, and the net diff against main at 5107231a969fa2c19b78f8a29e46002c30c16a85
· the check-runs on 5107231a969fa2c19b78f8a29e46002c30c16a85: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/ui/view-grouping-query.ts, packages/spec/src/ui/view.zod.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-35944/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.
----- to here -----

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5107231a969fa2c19b78f8a29e46002c30c16a85
Local-runs: none
Scope: packages/spec/src/ui/view-grouping-query.ts, packages/spec/src/ui/view.zod.ts + packages/lint/src/validate-list-view-field-refs.ts, packages/lint/src/rule-explanations.ts, ui/packages/plugin-grid/src/useWholeSetSummary.ts, ui/packages/plugin-grid/src/useColumnSummary.ts

Read at 2026-11-20T22:44Z: card #35702 (body and all seven comments, rulings 7045525672 and 7051689474 included), PR #35944 (body, the 30-file list, the net diff against main), and the check-runs on the head. The remainder of the diff (tests, the eleven locale packs, docs, generated baselines, the changeset prose) is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

  • ColumnSummarySchema accept-set: gains count_true and count_false, nothing removed or renamed. Right: a widening, and the card's 要做的 names exactly these two.
  • ListColumn.summary (string form and the { type, field } form) accepts the two members by reference. Right; Metadata-protocol: added is the matching line.
  • ColumnSummaryAggregation, the derived arm: from widens from the literal count to count | sum, and a required reads tuple is added. Right as built: it is an output type that only the table constructs, and from stays the first of reads, so a consumer still asking the one from node gets a correct count_true and an undefined (no figure) count_false, never a wrong number.
  • New public exports ColumnSummaryDerivedSource, columnSummaryNodeFunctions, COLUMN_SUMMARY_FIELD_TYPES, isColumnSummaryCompatibleWithFieldType: all four are in api-surface/ui.json and export-origins/ui.json. Right.
  • deriveColumnSummary / ColumnSummaryValue: the two members read back as a number. Right; they never answer null (a SUM that answered no value reads 0).
  • Lint accept-set: list-view-summary-field-type-refused now also refuses the two NEW members over a non-boolean field. Right, and not a narrowing: no declaration that parsed before this PR is newly refused.
  • Gate verdicts are the head's check-runs: every run concluded success or skipped (Test Core 1-10, Test UI 1-16, TypeScript Type Check, Type Check UI, Lint and Repo Gates, Check Changeset, Spec property liveness, Governed Surface Queue Guard, Build Core / UI / Docs, Live E2E UI, Dogfood Regression Gate). None failed.

② Semver level

Clause-②: yes (widening) — on the PR body and in .changeset/35702-boolean-yes-no-counts.md, with Metadata-protocol: added on both. @objectstack/spec minor (two authorable enum members, four new exports) and @objectstack/lint minor (a new refusal that only the new members can earn) match what the diff publishes. @object-ui/plugin-grid and @object-ui/i18n at patch follow the repo's standing practice for UI feature changesets (the sibling list-page changesets on main do the same). Check Changeset is green on the head. Right level.

③ Boundary flags

  • Open fork from the claim (does an unset boolean count as 否): answered by maintainer ruling 7051689474, option A. The tree builds A: count_false is count_FIELD − sum_FIELD, never the record count; a null cell is in neither count; an all-null or empty set reads 0 for 是. Checked in deriveColumnSummary, in the page fallback (=== true / === false) and in the docs strings.
  • open_questions: none carried on this PR. PR 1's report carried [].
  • Disclosed by the dev, not in scope: the edit form draws an unset boolean as an unticked box. The ruling records it as outside the ruling. No action here.
  • Disclosed by the dev: the group header compiler reads no field types, so an unlinted count_true over a number answers that column's sum. Accepted as the same tier the aggregate × field-type pairs are judged at; see N4 for the one path the lint does not cover.
  • SQL push-down (Prime Directive 5): holds. Both counts are aggregate nodes in the ONE existing aggregate query (SUM(field) and COUNT(field), deduplicated with any sum / count_empty on the same field). No id materialisation, no in-app join, no new AggregationFunction, no driver change. The page fallback is the pre-existing no-aggregate-door path, labelled as the page's.
  • Body claim that the tree does not carry, for the seat to correct before the maintainer reads it (a body edit, the head does not move): 维护者速读 says 「分组时每组标题上也能显示这两个数」. The spec compiler and deriveColumnSummary do serve the two members on a group header row, and the REST door test covers that. The console does not draw them there: its group headers read schema.aggregations in the grid's own six-member vocabulary (useGroupedData.ts SERVER_SUMMARY: sum, count, avg, min, max, count_distinct), not the columns' summary, and this PR does not change that. In the console the two counts appear in the footer only.

④ Design judgment

No must-fix, no should-fix.

packages/spec/src/ui/view.zod.ts — holds. The two members are the card's, the jsdoc and the .describe state ruling 7051689474 (a null cell is neither, 是 + 否 = filled), and both rows exist in COLUMN_SUMMARY_AGGREGATION as the file's own rule demands. First consumer (useColumnSummary / useWholeSetSummary) reads them through the spec's table and read-back.

packages/spec/src/ui/view-grouping-query.ts — holds. Tried to break it on:

  • the ground: sum over boolean and toggle is in AGGREGATE_FIELD_TYPE_COMPATIBILITY on main on the authority of ruling [finding] AGGREGATION_ROWS has no boolean column, so the cross-driver aggregation conformance family cannot see a boolean aggregand on any face #11152, pinned by AGGREGATION_CASES (sum(flag)=3), with the Postgres int cast in driver-sql. The claim cited is the claim the tree makes.
  • nulls: SUM and COUNT(field) both skip nulls, so count − sum is exactly the explicit-false count. sum === null reads 0 true; a missing sum column reads undefined; a missing or null count column reads undefined for count_false rather than a guess.
  • the compiler loop: every node of reads passes the alias-collision check before it is added; the fieldless count still rides the group count; a sum summary on the same field shares the node.
  • the multi-level fold: sum_FIELD and count_FIELD both fold exactly, so both members do.
  • the field-type table: isColumnSummaryCompatibleWithFieldType is fail-closed on shape, guarded by hasOwnProperty, and the pin test holds the list equal to BOOLEAN_VALUE_TYPES.

Implementing files, against the contract:

  • packages/lint/src/validate-list-view-field-refs.ts — agrees. A restricted member is resolved before the aggregate-kind early return and judged by the spec's table; the four COUNT(field) members still return unjudged; both carriers (list view columns, object-grid page columns) share the one function. rule-explanations.ts says the same.
  • ui/packages/plugin-grid/src/useWholeSetSummary.ts — agrees. It asks columnSummaryNodeFunctions(mapping), the same reading as the compiler, so the footer's whole-set question and the group header's cannot differ.
  • ui/packages/plugin-grid/src/useColumnSummary.ts — agrees. The menu offers the two members only where the spec's table allows; the page fallback counts only a real true / false, which is the boolean cell's own reading on main (BooleanCellRenderer: a non-boolean is "No value"), so page and server agree on a null cell; both members sit in the plain-count family, so no currency or percent formatting touches them.

Nits (no effect on correctness or the contract; none is fixed on this head — accepted deviations or one follow-up card):

  • N1 (nit) — view-grouping-query.ts: the long jsdoc that documents ColumnSummaryAggregation now sits above the new ColumnSummaryDerivedSource declaration, with that type's own one-line jsdoc between them. ColumnSummaryAggregation itself carries no doc comment any more. Move the new type above the block.
  • N2 (nit) — view-grouping-query.ts, Multi-level grouping paragraph: it derives count_false "from the folded sum" alone; it also reads the folded count_FIELD. The table above it is right.
  • N3 (nit) — validate-list-view-field-refs.ts: the refusal message ends "here it would print a total as a count". That is true over a numeric field. Over text, or a formula, the door refuses the SUM itself and nothing is printed. The refusal and the rule id are right; only the reason is too narrow.
  • N4 (nit) — view.zod.ts jsdoc says the two members "are refused over any other field type" without saying by whom. The refusal is the authoring lint's; the schema, the compiler and the footer hook accept the pair. A declaration that reaches the grid unlinted (not measured here: whether a personal-view write passes the lint) would draw a number column's whole-set total under 是, while the page fallback draws 0. A draw-time check of isColumnSummaryCompatibleWithFieldType in useScopedColumnSummary would close it; follow-up card, not this PR.
  • N5 (nit) — view-grouping-query.ts: the reads tuples and BOOLEAN_SUMMARY_FIELD_TYPES are readonly in type only; the outer tables are frozen, the inner arrays are not (the AGGREGATE_FIELD_TYPE_COMPATIBILITY rows are frozen).

Implemented-by: claude/project-thread-9i3wbo
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

L2 adoption and landing · 2026-11-20T22:50Z · The seat adopts the isolated contract-review record 7052446592 on head 5107231a (served at CONTRACT_REVIEW_TIER, posted with tier evidence, owed by the published-schema face packages/spec/src/ui/** and Clause-②: yes (widening)). It is PASS with no must-fix or should-fix, and its brief is this PR's earlier comment. It confirms the maintainer's ruling 7051689474 (option A) in code: count_false = count_<field> − sum_<field>, a null cell is in neither count, and 「是」 reads 0 when there are no values. Nits N1–N5 are carried with no rework. The record's ③ item, that the 维护者速读 over-claimed group headers, is fixed in the PR body without moving the head. The changeset headline is left as is: it is accurate for what the spec serves.

L1-b ACCEPT 7051975722 on 5107231a (this head). check-governed-merges --pr 35944 reads NOT governed, with 609 changed lines. landing-k reads K = 7. On this head, check-runs read skipped:13, success:65, and the PR is mergeable clean. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35702.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ui size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

列表底部计算行:常驻一行,用户点列底下的格子选计算(合计、平均、计数等),存到视图上

2 participants